---@diagnostic disable: undefined-global
rednet.open("right")

if rednet.isOpen("right") then
    print("rednet is OK!\n")
end
local id,msg



while rednet.isOpen("right") do
    
    repeat id,msg = rednet.receive()
    until id == 44
    print(("[%d]%s"):format(id,msg))
    if tonumber(msg)  == 13 then
        turtle.back()
    end
    if tonumber(msg) == 9 then
        turtle.forward()
    end
    if tonumber(msg) == 7 then
        turtle.turnLeft()
        turtle.forward()
        turtle.turnRight()
    end
    if tonumber(msg) == 10 then
        turtle.turnRight()
        turtle.forward()
        turtle.turnLeft()
        
    end

    id = 0 
    sleep(0.1)
end